Skip to main content

ECS Mandate Classifier API

The following document highlights the details of the ECS Mandate Classifier API.

API Description

Objective

The ECS Mandate Classifier API classifies a PDF or image as either an ECS Mandate or a different type of document.

InputOutput
An image or a PDFThe result indicating whether the document provided is an ECS Mandate or some other document
info
An ECS (Electronic Clearing Service) mandate is an authorization form that allows a bank to automatically debit or credit a customer's account for recurring payments. It essentially gives a user institution (like a lender or service provider) permission to make electronic transfers on a regular basis without manual intervention.

API URL

https://ind-engine.thomas.hyperverge.co/v1/readECSClass

API Endpoint

readECSClass

Overview

The ECS Mandate Classifier API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Method - POST

Authentication

You need a unique pair of application ID ( appId ) and application key ( appKey ) from HyperVerge to verify your identity for accessing the ECS Mandate Classifier API.

Headers

HeaderMandatory / OptionalDescriptionInput Format
content-type MandatoryThis parameter defines the media type for the request payloadmultipart/form-data
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
transactionIdMandatoryUnique ID for the customer journeyAny defined unique value mapped to a transaction in your business ecosystem

Inputs

The following table provides the details of the parameters required for the ECS Mandate Classifier API's request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
imageMandatoryfileThe input PDF or image file on which the classification is to be performedImage file (JPEG, JPG, PNG) or PDFNot Applicable
Caution
  • If multiple images are sent to the server in the same call, only one of the images will be read. Hence it is advisable to only send one image per call.
  • If the PDF file has multiple pages, only the first page will be considered for the OCR extraction.

Request

The following code snippet demonstrates a standard curl request for the ECS Mandate Classifier API:

curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/readECSClass' \
--header 'appid: <Enter_the_appId-Shared-by-HyperVerge>' \
--header 'appkey: <Enter_the_appKey-shared-by-HyperVerge>' \
--header 'transactionId : <Enter_the_Transaction_ID>' \
--form 'image=@"<path_to_image_file>"'

Success Response

The following code snippet demonstrates a success response from the ECS Mandate Classifier API:

{
"status": "success",
"statusCode": 200,
"result": {
"type": "ECS Mandate"
},
"metadata": {
"requestId": "<Request_ID>"
}
}

Success Response Details

The following table outlines the details of the success response from the ECS Mandate Classifier API:

ParameterTypeDescription
statusstringThe status of the request
statusCodeintegerThe HTTP status code returned for the request
resultobjectContains the classification result
typestringThe classification result indicating whether the document is an ECS Mandate or another type
metadataobjectContains request and transaction identifiers
requestIdstringA unique identifier for the request

Failure Response

The following code snippet demonstrates a failure response from the ECS Mandate Classifier API:

{
"status": "failure",
"statusCode": 400,
"error": "API call requires one input image"
}

Error Responses

The following are some error responses from the ECS Mandate Classifier API:

{
"status": "failure",
"statusCode": 400,
"error": "API call requires one input image"
}

Error Response Details

A failure or error response contains a failure status with a relevant status code and error message.
The following table lists all error responses:

Status CodeError MessageError DescriptionError Resolution
400API call requires one input imageThe request does not include an input image, which is mandatory for processing.Ensure the request includes the image parameter with a valid image or PDF file
400Image size cannot be greater than 6MBThe provided image exceeds the maximum allowed size of 6MB.Reduce the image file size to 6MB or less before submitting the request
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid valuesProvide valid appId and appKey credentials in the request
422Document Not DetectedThe system was unable to detect any document in the provided image.Ensure the image contains a clear and visible ECS Mandate document, or contact the HyperVerge team if the issue persists
500Internal Server ErrorThere was an error with HyperVerge's serverPlease check the request headers or contact the HyperVerge team for resolution
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: